package com.cloudlinkscm.base.authcenter.model;

import javax.persistence.Transient;
import java.util.Collection;

/**
 * Created by sin on 2017/7/27.
 *
 * 用户：账户
 *
 * <p>
 *     UserAccount 抽离用户的 auth 行为。
 *     与 tenant 中的 user id 对应.
 * </p>
 */
public class UserAccount extends GenericGuidBizModel {

	/**
	 * 用户编号
	 */
	private String userId;
    /**
     * 账户（账号）
     */
    private String account;
    /**
     * 密码
     */
    private String password;
    /**
     * 状态 1、激活 2、未激活 3、禁用
     */
    private Integer status;
	/**
	 * 混淆值
	 */
    private String salt;
    /**
     * 用户关联的角色
     */
    @Transient
    private Collection<Role> roles;

	@Override
	public String toString() {
		return "UserAccount{" +
				"userId='" + userId + '\'' +
				", account='" + account + '\'' +
				", password='" + password + '\'' +
				", status=" + status +
				", salt='" + salt + '\'' +
				", roles=" + roles +
				'}';
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public String getAccount() {
		return account;
	}

	public void setAccount(String account) {
		this.account = account;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	public String getSalt() {
		return salt;
	}

	public void setSalt(String salt) {
		this.salt = salt;
	}

	public Collection<Role> getRoles() {
		return roles;
	}

	public void setRoles(Collection<Role> roles) {
		this.roles = roles;
	}

}
